<template>
	<div>
		
		
		<div>
		
			<!-- Vuejs提供标签   插槽-->
			<slot></slot>
		
			
		</div>
		
		
		
		<span class='item '  v-for="(item,index) in items"   :class="selected==index?'active':''" 
				
				@click="selected=index"
		> {{item}}</span>
		

		
	</div>
	
	
	
	
</template>

<script>
	export default{
		name:'Tab',
		props:[
			'items'
		],
		data(){
			return{
				selected:0,
				//items:['图片','新闻','网页']
			}
		}
	}
</script>

<style scoped>
	.item{
		cursor: pointer;
	}
	.active{
		background-color: black;
		color: white;
	}
	
</style>